<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <div data-th-replace="layout/head-top"></div>
    <style type="text/css">
        .form-inline .form-control {
            display: inline-block;
            width: 70px;
            margin: 0 3px;
            vertical-align: middle;
        }
    </style>
</head>

<body>
<input type="hidden" id="integralType" th:value="${type}">
    <div  id="app" class="wrapper wrapper-content animated fadeInLeft">
        <div class="row">
            <div class="float-e-margins">
                <div>
                        <div class="form-inline" style="height: 185px;overflow-y: auto;overflow-x: hidden">
                        <input type="hidden" id="key" th:value="${key}">
                        <input type="hidden" id="isList" th:value="${isList}">
                        <th:block th:if="${key}=='VALIDTIME'">
                            <form  id='VALIDTIME' >
                                <div class="radio i-checks">
                                    <label class="">
                                        <div class="iradio_square-green" style="position: relative;">
                                            <input type="radio" id  name="type" value="1">
                                        </div> <i></i> 永久有效
                                    </label>
                                </div>
                                <div class="radio i-checks m-t">
                                    <label class="">
                                        <div class="iradio_square-green">
                                            <input type="radio" checked="" value="2"  name="type">
                                        </div>
                                        <span class="m-r-lg">
                                        每年
                                        <input class="form-control"  name="month"   th:value="${integralRuleMap.VALIDTIME.contextTreeMap.month}" placeholder="月" type="text">月
                                        <input class="form-control"  name="day"   th:value="${integralRuleMap.VALIDTIME.contextTreeMap.day}" placeholder="日">日 清空积分
                                    </span>
                                    </label>
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='PROTECT'">
                            <form  id='PROTECT' class="row"  >
                                <div class="m-l-lg m-r-lg">
                                    积分在发放后将进入
                                    <input class="form-control"  name="day"  th:value="${integralRuleMap.PROTECT.contextTreeMap.day}" placeholder="请输入正整数，建议保护期1-5天" type="text">
                                    天保护期，此期间不可使用
                                </div>
                            </form >
                        </th:block>
                        <th:block th:if="${key}=='NAME'">
                            <form  id='NAME' >
                                <div class="m-l-lg m-r-lg">
                                    积分名称
                                    <input class="form-control"  name="name" th:value="${integralRuleMap.NAME.contextTreeMap.name}" placeholder="积分名称" maxlength="3" type="text">
                                    <p class="m-t">
                                        <span class="c-999">根据运营不同，展示给前端学员的名称，如：学币。最多不超过3个字</span>
                                    </p>
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='REGISTER'">
                            <form  id='REGISTER' >
                                <div class="m-l-lg m-r-lg">
                                    成功注册为平台学员获取
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.REGISTER.contextTreeMap.score}">积分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='LOGIN'">
                            <form  id='LOGIN'  >
                                <th:block th:each="object,status:${integralRuleMap.LOGIN.contextList}">
                                    <div class="m-l-lg m-r-lg m-b">
                                        学员登录<input class="form-control" type="text" name="unit"   th:value="${object.unit}" >天，获取<input class="form-control" type="text" name="score"  th:value="${object.score}">积分
                                    </div>
                                </th:block>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='PAYSUCCESS'">
                            <form  id='PAYSUCCESS' >

                                <div class="m-l-lg m-r-lg">
                                    学员每成功支付一笔订单 获取
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.PAYSUCCESS.contextTreeMap.score}"> 积分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='COURSE'">
                            <form  id='COURSE' >

                                <div class="m-l-lg m-r-lg">
                                    学员每看一节课获取
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.COURSE.contextTreeMap.score}"> 积分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='EXERCISE'">
                            <form  id='EXERCISE' class="form-inline ">
                                <th:block th:each="object:${integralRuleMap.EXERCISE.contextList}">
                                    <div class="m-l-lg m-r-lg m-b">
                                        <span>学员累计做题量达 </span>
                                        <input class="form-control" type="text" name="unit"  th:value="${object.unit}" >道题，
                                        <span>获取</span>
                                        <input class="form-control" type="text" name="score"  th:value="${object.score}"> 积分，
                                        <span>每天得分上限</span>
                                        <input class="form-control" type="text" name="max"  th:value="${object.max}">分
                                        <p>(同一试卷不累加)</p>
                                    </div>
                                </th:block>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='QUESTION'">
                            <form  id='QUESTION' class="form-inline ">
                                <th:block th:each="object:${integralRuleMap.QUESTION.contextList}">
                                    <div class="m-l-lg m-r-lg m-b">
                                        <span>学员成功提问专业问题累计 </span>
                                        <input class="form-control" type="text" name="unit"  th:value="${object.unit}" >个，
                                        <span>获取</span>
                                        <input class="form-control" type="text" name="score"  th:value="${object.score}"> 积分，
                                        <span>每天得分上限</span>
                                        <input class="form-control" type="text" name="max"  th:value="${object.max}">分
                                    </div>
                                </th:block>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='ONLOOK'">
                            <form  id='ONLOOK' class="form-inline ">
                                <div class="m-l-lg m-r-lg">
                                    <span>学员成功围观付费问题，获取</span>
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.ONLOOK.contextTreeMap.score}">
                                    <span>积分 每天得分上限为</span>
                                    <input class="form-control" type="text" name="max"  th:value="${integralRuleMap.ONLOOK.contextTreeMap.max}">分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='ANSWER'">
                            <form  id='ANSWER' >
                                <div class="m-l-lg m-r-lg">
                                    <span>学员成功回答学员问题，获取</span>
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.ANSWER.contextTreeMap.score}">
                                    <span>积分 每天得分上限为</span>
                                    <input class="form-control" type="text" name="max"  th:value="${integralRuleMap.ANSWER.contextTreeMap.max}">分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='TOPIC'">
                            <form  id='TOPIC' >
                                <div class="m-l-lg m-r-lg">
                                    <span>学员成功回答学员问题，获取</span>
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.TOPIC.contextTreeMap.score}">
                                    <span>积分 每天得分上限为</span>
                                    <input class="form-control" type="text" name="max"  th:value="${integralRuleMap.TOPIC.contextTreeMap.max}">积分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='SHARE'">
                            <form  id='SHARE' >
                                <div class="m-l-lg m-r-lg">
                                    <div class="m-b">
                                        学员通过海报分享时，获取
                                        <input class="form-control" type="text" name="shareScore"  th:value="${integralRuleMap.SHARE.contextTreeMap.shareScore}"> 积分
                                        每天得分上限为
                                        <input class="form-control" type="text" name="max"  th:value="${integralRuleMap.SHARE.contextTreeMap.max}"> 分
                                    </div>
                                    <div class="m-b">
                                        学员通过海报分享并通过分享每成功引流 1 个时，获取
                                        <input class="form-control" type="text" name="shareSuccess"  th:value="${integralRuleMap.SHARE.contextTreeMap.shareSuccess}"> 积分无上限限制
                                    </div>
                                    <div class="m-b">
                                        学员通过海报分享并通过分享每成功引流  1 个并成功消费时，获取
                                        <input class="form-control" type="text" name="sharePay"  th:value="${integralRuleMap.SHARE.contextTreeMap.sharePay}">积分  无上限限制
                                    </div>
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='SIGNIN'">
                            <form  id='SIGNIN' >
                                <div class="m-l-lg m-r-lg">
                                    <span>学员签到成功，获取</span>
                                    <input class="form-control" type="text" name="score"  th:value="${integralRuleMap.SIGNIN.contextTreeMap.score}">积分
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='RATIO'">
                            <form  id='RATIO' >
                                <div class="m-l-lg m-r-lg">
                                    <p>选择平台积分消费模式：</p>
                                    <div class="checkbox i-checks">
                                        <label for="">
                                            <input type="checkbox" name="isGoods" th:checked="${integralRuleMap.RATIO.contextTreeMap.isGoods}" >
                                            积分兑换商品
                                        </label>
                                        <label for="">
                                            <input type="checkbox" name="isMoney" th:checked="${integralRuleMap.RATIO.contextTreeMap.isMoney}">
                                            积分兑换现金
                                        </label>
                                    </div>
                                    <div class="m-l-md">
                                        <span>积分兑换现金比例：</span>
                                        <input class="form-control" type="text" name="integral"  th:value="${integralRuleMap.RATIO.contextTreeMap.integral}">:
                                        <input class="form-control" type="text" name="money"  th:value="${integralRuleMap.RATIO.contextTreeMap.money}">
                                        <span class="m-l">(n积分可兑换x元人民币现金)</span>

                                    </div>
                                </div>
                            </form>
                        </th:block>
                        <th:block th:if="${key}=='ALERT'">
                            <form  id='ALERT' >
                                <div class="m-l-lg m-r-lg">

                                </div>
                                <div class="media">
                                    <div class="media-left">
                                        <img class="media-object img-circle logo-img" alt="logo" style="width: 84px; height: 84px;">
                                        <input type="hidden" id="logoUrl" name="url" >
                                    </div>
                                    <div class="media-body" style="display: table-cell">
                                        <h4 class="media-heading">
                                            <button class="btn btn-primary" id="upload_img" type="button"><i class="fa fa-image"></i>&nbsp;选择文件</button>
                                        </h4>
                                        <span class="c-999 fs12">图片格式为：jpg\jpeg\png\gif\bmp <br />尺寸为：1:1，大小不超过1M</span>
                                    </div>
                                </div>
                            </form>
                        </th:block>
                    </div>

                    <div class="hr-line-dashed"></div>
                    <div class="m-t-lg text-center">
                        <button class="btn btn-w-m btn-primary" onclick="openUpdateProtect()">保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/common/summernote/summernote.min.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/user/integral/integralruleform.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>